* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
}

/* 背景图片加载完成后的样式 */
body.bg-loaded {
    background: url('A.PNG') center center/cover no-repeat fixed;
    background-attachment: fixed;
}

/* 添加半透明遮罩层以确保文字可读性 */
body.bg-loaded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    z-index: 0;
    pointer-events: none;
    animation: fadeIn 0.5s ease;
}

/* 加载屏幕样式 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-heart {
    font-size: 4rem;
    animation: heartBeat 1.5s ease-in-out infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff6b9d, #4ecdc4);
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 飘落的爱心动画 */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff6b9d;
    transform: rotate(45deg);
    animation: fall linear infinite;
    opacity: 0.7;
}

.heart:before,
.heart:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff6b9d;
    border-radius: 50%;
}

.heart:before {
    top: -10px;
    left: 0;
}

.heart:after {
    top: 0;
    left: -10px;
}

.heart:nth-child(1) {
    left: 10%;
    animation-duration: 3s;
    animation-delay: 0s;
}

.heart:nth-child(2) {
    left: 20%;
    animation-duration: 4s;
    animation-delay: 1s;
}

.heart:nth-child(3) {
    left: 30%;
    animation-duration: 3.5s;
    animation-delay: 2s;
}

.heart:nth-child(4) {
    left: 40%;
    animation-duration: 4.5s;
    animation-delay: 0.5s;
}

.heart:nth-child(5) {
    left: 50%;
    animation-duration: 3s;
    animation-delay: 1.5s;
}

.heart:nth-child(6) {
    left: 60%;
    animation-duration: 4s;
    animation-delay: 2.5s;
}

.heart:nth-child(7) {
    left: 70%;
    animation-duration: 3.5s;
    animation-delay: 0.8s;
}

.heart:nth-child(8) {
    left: 80%;
    animation-duration: 4.2s;
    animation-delay: 1.8s;
}

@keyframes fall {
    0% {
        top: -10%;
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        top: 110%;
        opacity: 0;
    }
}

/* 主容器 */
.container {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题部分 */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 1s ease-out;
}

.main-title {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: #f0f0f0;
    font-weight: 300;
}

/* 时间轴 */
.timeline {
    position: relative;
    margin: 60px 0;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #ff6b9d, #4ecdc4);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 40px 0;
    animation: fadeInUp 1s ease-out;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: 60%;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 60%;
    text-align: left;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 20px;
    width: 20px;
    height: 20px;
    background: #ff6b9d;
    border: 4px solid #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timeline-content h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.timeline-content p {
    color: #f0f0f0;
    line-height: 1.6;
    font-size: 1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

/* 表白内容 */
.confession {
    margin: 80px 0;
    animation: fadeIn 1.5s ease-out;
}

.confession-content {
    background: transparent;
    padding: 50px;
    text-align: center;
    perspective: 1000px;
}

.confession-title {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.love-letter {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.letter-envelope {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transition: all 0.5s ease;
}

.letter-envelope:hover {
    transform: rotateY(5deg) rotateX(5deg);
}

.letter-paper {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 3px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.letter-paper:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,107,157,0.1) 0%, rgba(78,205,196,0.1) 100%);
    z-index: 0;
}

.letter-opening {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
    position: relative;
}

.letter-paragraph {
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.3s ease;
}

.letter-paragraph:hover {
    transform: translateX(5px);
}

.letter-ps {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
    position: relative;
}

.letter-closing {
    margin-top: 40px;
    color: #333;
    font-size: 1.1rem;
    position: relative;
}

.letter-signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: #ff6b9d;
    margin-top: 10px;
    display: inline-block;
    transform: rotate(-5deg);
    position: relative;
}

/* 按钮 */
.buttons {
    text-align: center;
    margin: 60px 0;
    animation: fadeInUp 1.5s ease-out;
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    margin: 0 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif SC', serif;
    font-weight: 500;
}

.btn-yes {
    background: linear-gradient(45deg, #ff6b9d, #ff8a80);
    color: white;
    box-shadow: 0 10px 20px rgba(255, 107, 157, 0.3);
}

.btn-yes:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 107, 157, 0.4);
}

.btn-no {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    box-shadow: 0 10px 20px rgba(78, 205, 196, 0.3);
}

.btn-no:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(78, 205, 196, 0.4);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    width: 80%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.5s ease-out;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

#response-text {
    font-size: 1.3rem;
    color: #333;
    line-height: 1.6;
}

/* 动画 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* 音乐控制样式 */
.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.music-control button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.music-control button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.music-control input[type="range"] {
    width: 100px;
    height: 5px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    outline: none;
}

.music-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

/* 爱心浮动动画 */
@keyframes heartFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .music-control {
        bottom: 15px;
        right: 15px;
    }
    
    .music-control button {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .music-control input[type="range"] {
        width: 80px;
    }

    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .timeline:before {
        left: 30px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 60px;
        margin-right: 0;
        text-align: left;
    }
    
    .timeline-marker {
        left: 30px;
    }
    
    .confession-content {
        padding: 30px 20px;
    }
    
    .confession-content h2 {
        font-size: 2rem;
    }
    
    .btn {
        display: block;
        margin: 15px auto;
        width: 200px;
    }
    
    .modal-content {
        width: 90%;
        margin: 30% auto;
        padding: 30px 20px;
    }
}